package org.spring.springboot.app.sys.systemoption.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.spring.springboot.app.base.R;
import org.spring.springboot.app.sys.systemoption.service.ISystemOptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import java.text.SimpleDateFormat;
import java.util.Date;

@ApiIgnore
@Api(description="系统参数相关操作")
@RequestMapping(value = "/api/SystemOption")
@RestController
public class SystemOptionController {

    @Autowired
    private ISystemOptionService systemOptionService;

    @ApiOperation(value="刷新缓存")
    @RequestMapping("/refresh")
    public R refresh() throws Exception {
        System.out.println(">>>>>>>>>>>>>>>手动执行，执行加载数据等操作<<<<<<<<<<<<<");
        systemOptionService.init();
        return new R().success();
    }

    @RequestMapping("/testoption")
    public void test() throws Exception {
        System.out.println(systemOptionService.getString("touchapp.alipay.partner"));
    }

}
